import { http } from "@/utils/http";

export type commonResult<T> = {
  code: number;
  msg: string;
  result: T;
};

/** 3.1.14 巡检记录 */
export const getInspectionRecord = (params?: object) => {
  return http.request<commonResult<any>>("get", '/screen/statistic/v2/inspection/missions', {
    params
  });
};
/** 3.1.16 巡检任务详情 */
export const getInspectionDetail = (params?: object) => {
  return http.request<commonResult<any>>("get", '/screen/statistic/v2/inspection/mission', {
    params
  });
};
/** 3.1.15 巡检记录详情设施列表 */
export const getInspectionDetailFacilities = (params?: object) => {
  return http.request<commonResult<any>>("get", '/screen/statistic/v2/inspection/mission/facilites', {
    params
  });
};
/** 3.1.17 派发工单 */
export const sendOrder = (data?: object) => {
  return http.request<commonResult<any>>("post", "/screen/statistic/v2/inspection/mission/work-order",
    {
      data
    }
  );
};
/** 3.1.18 一键派发工单 */
export const autoSendOrder = (data?: object) => {
  return http.request<commonResult<any>>("post", "/screen/statistic/v2/inspection/mission/auto-dispatch-work-order",
    {
      data
    }
  );
};